package com.entity.view;

import com.annotation.ColumnInfo;
import com.baomidou.mybatisplus.annotations.TableName;
import com.entity.ChatEntity;
import org.apache.commons.beanutils.BeanUtils;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;

/**
 * 客服聊天
 * 后端返回视图实体辅助类
 * （通常后端关联的表或者自定义的字段需要返回使用）
 */
@TableName("chat")
public class ChatView extends ChatEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    //当前表
    /**
     * 状态的值
     */
    @ColumnInfo(comment = "状态的字典表值", type = "varchar(200)")
    private String zhuangtaiValue;
    /**
     * 数据类型的值
     */
    @ColumnInfo(comment = "数据类型的字典表值", type = "varchar(200)")
    private String chatValue;

    //级联表 用户
    /**
     * 用户姓名
     */

    @ColumnInfo(comment = "用户姓名", type = "varchar(200)")
    private String yonghuName;
    /**
     * 头像
     */

    @ColumnInfo(comment = "头像", type = "varchar(255)")
    private String yonghuPhoto;
    /**
     * 用户手机号
     */

    @ColumnInfo(comment = "用户手机号", type = "varchar(200)")
    private String yonghuPhone;
    /**
     * 用户身份证号
     */

    @ColumnInfo(comment = "用户身份证号", type = "varchar(200)")
    private String yonghuIdNumber;
    /**
     * 余额
     */
    @ColumnInfo(comment = "余额", type = "decimal(10,2)")
    private Double newMoney;
    /**
     * 假删
     */

    @ColumnInfo(comment = "假删", type = "int(11)")
    private Integer yonghuDelete;


    public ChatView() {

    }

    public ChatView(ChatEntity chatEntity) {
        try {
            BeanUtils.copyProperties(this, chatEntity);
        } catch (IllegalAccessException | InvocationTargetException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }


    //当前表的

    /**
     * 获取： 状态的值
     */
    public String getZhuangtaiValue() {
        return zhuangtaiValue;
    }

    /**
     * 设置： 状态的值
     */
    public void setZhuangtaiValue(String zhuangtaiValue) {
        this.zhuangtaiValue = zhuangtaiValue;
    }
    //当前表的

    /**
     * 获取： 数据类型的值
     */
    public String getChatValue() {
        return chatValue;
    }

    /**
     * 设置： 数据类型的值
     */
    public void setChatValue(String chatValue) {
        this.chatValue = chatValue;
    }


    //级联表的get和set 用户

    /**
     * 获取： 用户姓名
     */
    public String getYonghuName() {
        return yonghuName;
    }

    /**
     * 设置： 用户姓名
     */
    public void setYonghuName(String yonghuName) {
        this.yonghuName = yonghuName;
    }

    /**
     * 获取： 头像
     */
    public String getYonghuPhoto() {
        return yonghuPhoto;
    }

    /**
     * 设置： 头像
     */
    public void setYonghuPhoto(String yonghuPhoto) {
        this.yonghuPhoto = yonghuPhoto;
    }

    /**
     * 获取： 用户手机号
     */
    public String getYonghuPhone() {
        return yonghuPhone;
    }

    /**
     * 设置： 用户手机号
     */
    public void setYonghuPhone(String yonghuPhone) {
        this.yonghuPhone = yonghuPhone;
    }

    /**
     * 获取： 用户身份证号
     */
    public String getYonghuIdNumber() {
        return yonghuIdNumber;
    }

    /**
     * 设置： 用户身份证号
     */
    public void setYonghuIdNumber(String yonghuIdNumber) {
        this.yonghuIdNumber = yonghuIdNumber;
    }

    /**
     * 获取： 余额
     */
    public Double getNewMoney() {
        return newMoney;
    }

    /**
     * 设置： 余额
     */
    public void setNewMoney(Double newMoney) {
        this.newMoney = newMoney;
    }

    /**
     * 获取： 假删
     */
    public Integer getYonghuDelete() {
        return yonghuDelete;
    }

    /**
     * 设置： 假删
     */
    public void setYonghuDelete(Integer yonghuDelete) {
        this.yonghuDelete = yonghuDelete;
    }


    @Override
    public String toString() {
        return "ChatView{" +
                ", zhuangtaiValue=" + zhuangtaiValue +
                ", chatValue=" + chatValue +
                ", yonghuName=" + yonghuName +
                ", yonghuPhoto=" + yonghuPhoto +
                ", yonghuPhone=" + yonghuPhone +
                ", yonghuIdNumber=" + yonghuIdNumber +
                ", newMoney=" + newMoney +
                ", yonghuDelete=" + yonghuDelete +
                "} " + super.toString();
    }
}
